import vueRouter from 'vue-router'


// 引入所有的自己定义的单文件组件
import HomeContainer from './component/tabbar/HomeContainer.vue'
import MemberContainer from './component/tabbar/MemberContainer.vue'
import ShopcartContainer from './component/tabbar/ShopcartContainer.vue'
import SearchContainer from './component/tabbar/SearchContainer.vue'
import NewsContainer from './component/News/NewsContainer.vue'
import NewsInfo from "./component/News/NewsInfo.vue";
import PhotoList from "./component/Photos/PhotoList.vue"
import PhotoInfo from "./component/Photos/PhotoInfo.vue"
import GoodsList from "./component/Goods/GoodsList.vue"
import GoodsInfo from "./component/Goods/GoodsInfo.vue"
import GoodsDesc from "./component/Goods/GoodsDesc.vue"
import GoodsComment from "./component/Goods/GoodsComment.vue"

const router = new vueRouter({
    routes: [  // 配置路由
        {path: '/', redirect: '/home'},
        {path: '/home', component: HomeContainer},
        {path: '/member', component: MemberContainer},
        {path: '/shopcart', component: ShopcartContainer},
        {path: '/search', component: SearchContainer},
        {path: '/home/newslist', component: NewsContainer},
        {path: '/home/newsinfo/:id', component: NewsInfo},
        {path: '/home/PhotoList', component: PhotoList},
        {path: '/home/PhotoInfo/:id', component: PhotoInfo},
        {path: '/home/GoodsList', component: GoodsList},
        {path: '/home/GoodsInfo/:id', component: GoodsInfo, name: 'GoodsInfo'},
        {path: '/home/GoodsDesc/:id', component: GoodsDesc, name: 'GoodsDesc'},
        {path: '/home/GoodsComment/:id', component: GoodsComment, name: 'GoodsComment'}

    ],
    linkActiveClass: 'mui-active' // 覆盖默认的路由高亮的类，默认的类叫做 router-link-active
})

export default router